package com.quyl.poi.util;

import java.io.FileWriter;
import java.io.IOException;

/**
 * 生成对应目录结构层级下的html文件
 */
public class HtmlUtil {

    public static void setHtml(String htmlContent,String filePath,String fileName) {
        StringBuilder sb = new StringBuilder();
        sb.append(htmlContent);
        // 将html文件写入磁盘指定位置
        FileWriter fw = null;
        try {
            fw = new FileWriter(filePath + fileName);
            fw.write(sb.toString());
        } catch (
                IOException e) {
            e.printStackTrace();
        } finally {
            if (fw != null) {
                try {
                    fw.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
